home *** CD-ROM | disk | FTP | other *** search
- Subject: Re: Paste Exception
- Sent: 6/11/96 3:32 PM
- Received: 6/11/96 3:52 PM
- From: Mark Lanett, mlanett@meer.net
- Reply-To: ODF Interest, ODF-Interest@CILabs.ORG
- To: OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
-
- >>Putting up the dialog at the point where you detect the error may not be
- >>best (especially if you are in the middle of a drag), but I don't know of
- >>any clean way to throw an exception and put up an alert afterwards. Perhaps
- >>you could set something up with idling.
- >
- >How does ODF handle the case where an exception from, say a memory
- >allocation failure, happens in the subclass of FW_CContent::Internalize
- >that had been called because of a drop? Something does put up a dialog,
- >right?
-
- All we ever do is throw an ODException*, which is a single integer.
- Exceptions from all parts eventually wind their way up the stack back to
- the OpenDoc event handler, which looks up the error code in its string
- table and displays a dialog. Only the standard error codes have strings;
- there is no way that I know of to supply your own. There is also no way to
- supply parameters.
-
- ODF's additional error codes have been assigned a range by Apple, but I
- don't actually know if we get user strings also, and again, you can't have
- pass parameters.
-
- What it comes down to is that for now you have to put up your own dialog
- and then throw an exception. This seems simple but isn't, because of cases
- like drag&drop, or perhaps your caller intended to catch any exception you
- threw and work around it without needing an alert dialog. The first case
- can be handled by putting up your alert when your Idle gets called (instead
- of at the error time), but for the second case... there is no way for you
- to know if your caller intended to supress your exceptions.
-
- *Actually we throw C++ FW_XException objects, which are converted to
- ODException when we return across the SOM boundary. This is way there's no
- real advantage to defining your own exception, since the non-OD-error-code
- portion will be lost.
-
-
- --
- Mark Lanett, OpenDoc Framework, Apple Computer
-
-